package softwaretest.dto;

import java.time.LocalDateTime;

public class CameraDataDTO {
    private LocalDateTime createdAt; // 数据创建时间
    private byte[] photo; // 照片数据

    // 无参构造方法
    public CameraDataDTO() {
    }

    // 带参构造方法，用于从实体类转换
    public CameraDataDTO(LocalDateTime createdAt, byte[] photo) {
        this.createdAt = createdAt;
        this.photo = photo;
    }

    // Getter 和 Setter 方法
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public byte[] getPhoto() {
        return photo;
    }

    public void setPhoto(byte[] photo) {
        this.photo = photo;
    }

    // toString 方法（可选）
    @Override
    public String toString() {
        return "CameraDataDTO{" +
                "createdAt=" + createdAt +
                ", photo=" + (photo != null ? "byte[" + photo.length + "]" : "null") +
                '}';
    }
}